package com.tfjybj.itoo.exam.provider.service;

import com.dmsdbj.itoo.tool.base.service.BaseServicePlus;
import com.dmsdbj.itoo.tool.business.ItooResult;
import com.tfjybj.itoo.exam.entity.EvaluationRecordEntity;
import com.tfjybj.itoo.exam.model.EvaluationRecordModel;

import java.util.List;


/**
 * TeEvaluationRecordService接口
 * teEvaluationRecord表
 *
 * @author 杨江涛
 * @version 2.0.0
 * @since 2.0.0 2018-12-18 18:19:48
 */
public interface EvaluationRecordService extends BaseServicePlus<EvaluationRecordEntity> {


    /**
     * 添加或更新问卷答题记录
     * @param teEvaluationRecordEntity 问卷答题记录实体
     * @return 添加成功
     * @author 杨晓慧
     * @since 2.0.0 2018-12-25 18:19:48
     */
    ItooResult insertOrUpdateEvaluationRecord(EvaluationRecordEntity teEvaluationRecordEntity);

    /**
     * 查询该题干的作答总人数
     * @param paperId  问卷id
     * @param schoolYearId  学期学年id
     * @param courseId 课程id
     * @param evaluationMainId 题干id
     * @return paperId schoolYearId courseId evaluationMainId
     * @author 杨晓慧
     * @since 2.0.0 2018-12-28 17:19:44
     */
    Integer queryParticipationNumber(String paperId, String schoolYearId, String courseId, String evaluationMainId);

    /**
     * 查某一个问题下的学生作答各选项的比例
     * @param paperId  问卷id
     * @param schoolYearId  学期学年id
     * @param courseId 课程id
     * @param evaluationMainId 题干id
     * @return 各选项的比例
     * @author 杨江涛
     * @since 2.0.0 2019年3月20日19:20:56
     */
    List<EvaluationRecordModel> queryOptionRatioResult(String paperId, String schoolYearId, String courseId, String evaluationMainId);


    /**
     * 查某一个问题下的学生作答当前选项的总人数
     * @param paperId  问卷id
     * @param schoolYearId  学期学年id
     * @param courseId 课程id
     * @param evaluationMainId 题干id
     * @param evaluationSubId  选项id
     * @return 某一个问题下的学生作答当前选项的总人数
     * @author 杨江涛
     * @since 2.0.0 2019-3-22 16:26:56
     */
    String queryOptionSelectedNumberBySubId(String paperId, String schoolYearId, String courseId, String evaluationMainId, String evaluationSubId);
    /**
         * 实时更新问卷记录
         * @param
         * @return Boolean
         * @author 魏恩君
         * @since 2.0.0 2019/3/20
         */

    Boolean updateEvaluationRecord(EvaluationRecordModel model);

}
